package com.blockmeta.bbs;

import android.content.Context;

import com.alibaba.android.arouter.facade.annotation.Route;
import com.blockmeta.bbs.baselibrary.provider.IApplicationProvider;
import com.blockmeta.bbs.baselibrary.provider.ProjectBuildInfo;
import com.blockmeta.bbs.businesslibrary.BaseBussinessApp;
import com.blockmeta.bbs.businesslibrary.arouter.RouterPath;
import com.blockmeta.bbs.businesslibrary.util.ProcessHelper;
import com.hellobike.flutter.thrio.module.ThrioModule;
import com.hellobike.flutter.thrio.navigator.FlutterEngineFactory;

/**
 * @author AirThor
 * @date 2019/7/19.
 */
@Route(path = RouterPath.APPLICATION_PROVIDER)
public class QuhuiApp extends BaseBussinessApp implements IApplicationProvider {

    @Override
    public void onCreate() {
        super.onCreate();
        if(ProcessHelper.isMainProcess(this)){
            ThrioModule.init(this, FlutterModule.INSTANCE);
        }else {
        }

    }

    @Override
    public ProjectBuildInfo getProjectBuildInfo() {
        if(projectBuildInfo != null) {
            return projectBuildInfo;
        }
        projectBuildInfo = ProjectBuildInfo.newBuilder()
                .application_id(BuildConfig.APPLICATION_ID)
                .build_type(BuildConfig.BUILD_TYPE)
                .debug(BuildConfig.DEBUG)
                .flavor(BuildConfig.FLAVOR)
                .version_code(BuildConfig.VERSION_CODE)
                .version_name(BuildConfig.VERSION_NAME)
                .build();
        return projectBuildInfo;
    }

    @Override
    public void init(Context context) {

    }
}